/*
 * Copyright (c) 2017. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 * Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
 * Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
 * Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
 * Vestibulum commodo. Ut rhoncus gravida arcu.
 */

package io.esirong.eye;


import java.util.HashMap;
import java.util.Map;


/**
 * Event行为事件 实体模型
 * 一个事件
 * Created by 黄嵘才(HuangRc) on 2016/12/23.
 */

public class Event {
    /**
     * keyID
     */
    public static final int ID = 1;
    /**
     * 人物（表演者）
     */
    private Actor actor2;
    /**
     * 场景
     */
    private Screen screen;
    /**
     * 动作
     */
    private Action action2;
    /**
     * 场景
     */
    private String scene;
    /**
     * 人物（表演者）
     */
    private String actor;
    /**
     * 动作
     */
    private String action;
    /**
     * 对象
     */
    public String target;
    /**
     * 时间(默认当前创建时间)
     */
    private long time = System.currentTimeMillis();
    /**
     * 属性
     */
    private Map<String, String> params = new HashMap<>();

    /**
     * 思路
     */
    private Event() {/*默认构造函数*/}

    private Event(String action) {
        this.action = action;
    }

    /**
     *
     * @param scene 当前的场景、视窗view
     * @return 一个简单的事件
     */
    public static Event create(String scene) {
        Event event = new Event();
        event.scene = scene;
        return event;
    }

    public String getScene() {
        return scene;
    }

    public void setScene(String scene) {
        this.scene = scene;
    }

    public String getActor() {
        return actor;
    }

    public void setActor(String actor) {
        this.actor = actor;
    }

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public String getTarget() {
        return target;
    }

    public void setTarget(String target) {
        this.target = target;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public Map<String, String> getParams() {
        return params;
    }

    public Actor getActor2() {
        return actor2;
    }

    public void setActor2(Actor actor2) {
        this.actor2 = actor2;
    }

    public Screen getScreen() {
        return screen;
    }

    public void setScreen(Screen screen) {
        this.screen = screen;
    }

    public Action getAction2() {
        return action2;
    }

    public void setAction2(Action action2) {
        this.action2 = action2;
    }

    public void setParams(Map<String, String> params) {
        this.params = params;
    }

    public static class Action {

        /**
         * 进入页面
         */
        public static final String ENTER = "enter";
        /**
         * 离开页面
         */
        public static final String LEAVE = "leave";
        /**
         * 停留页面
         */
        public static final String STOP = "stop";
        /**
         * 点击事件
         */
        public static final String CLICK = "click";
        /**
         * 输入开始
         */
        public static final String BEGIN = "begin";
        /**
         * 输入结束
         */
        public static final String END = "end";
        /**
         * 悬停中
         */
        public static final String HOVE = "hove";

    }

    /**
     * 演员（View控件）
     * Created by 黄嵘才(HuangRc) on 2018/1/29.
     */

    public static class Actor {

        private long ID;

        private String name;
    }

    @Override
    public String toString() {
        return "Event{" +
                "actor2=" + actor2 +
                ", screen=" + screen +
                ", action2=" + action2 +
                ", scene='" + scene + '\'' +
                ", actor='" + actor + '\'' +
                ", action='" + action + '\'' +
                ", target='" + target + '\'' +
                ", time=" + time +
                ", params=" + params +
                '}';
    }
}
